# Maintainer: Luca Weiss <luca@lucaweiss.eu>
pkgname=soc-qcom-sc7280
pkgdesc="Common package for Qualcomm SC7280/SM7325/QCM6490 devices"
pkgver=1
pkgrel=2
url="https://postmarketos.org"
license="BSD-3-Clause"
arch="aarch64"
options="!check !archcheck !tracedeps"
depends="
	bootmac
	linux-firmware-ath11k
	msm-modem
	msm-modem-uim-selection
	pd-mapper
	swclock-offset
	tqftpserv
"
subpackages="
	$pkgname-openrc
	$pkgname-qbootctl
	$pkgname-qbootctl-openrc:qbootctl_openrc
	$pkgname-vulkan
"

package() {
	mkdir -p "$pkgdir"
}

openrc() {
	install_if="$pkgname=$pkgver-r$pkgrel openrc"
	install="$subpkgname.post-install $subpkgname.post-upgrade"
	depends="
		pd-mapper-openrc
		tqftpserv-openrc
		"

	mkdir -p "$subpkgdir"
}

qbootctl() {
	pkgdesc="Enable qbootctl mark-boot-successful service"
	depends="qbootctl"

	mkdir -p "$subpkgdir"
}

qbootctl_openrc() {
	install_if="$pkgname-qbootctl=$pkgver-r$pkgrel openrc"
	install="$subpkgname.post-install $subpkgname.post-upgrade"
	depends="qbootctl-openrc"

	mkdir -p "$subpkgdir"
}

vulkan() {
	pkgdesc="Vulkan support for freedreno"
	install_if="$pkgname vulkan-loader"
	depends="mesa-vulkan-freedreno"
	mkdir "$subpkgdir"
}

